# 两数之和
class Solution(object):
    def twoSum(self,nums,target):
        """
        :type nums: List[int]
        :type target: int
        :rtype: List[int]
        """
        #枚举 enumerate
        d = {}
        for i ,num in enumerate(nums):
            if target - num in d:
                return [d[target - num],i]
            d[num] = i
